package com.dys.pojo;

/**
 * @className: com.dys.pojo.Emp
 * @description: com.dys.pojo
 * @author: pine cone
 * @version: v1.0.0
 * @createTime: 2024/11/07 22:20
 */
public class Emp {
    private int id;
    private String name;
    private int age;
    /**
     * 部门信息：1对1关联关系的体现,一个员工对象最多有一个部门对象
     */
    private Dept dept;

    public Emp() {
    }

    public Emp(int id, String name, int age, Dept dept) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.dept = dept;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Dept getDept() {
        return dept;
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }

    @Override
    public String toString() {
        return "Emp{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", dept=" + dept +
                '}';
    }
}
